<?php
/**
 * Response_Interface
 * @filesource
 */
/**
 * Namespace
 */
namespace framework\library\interfaces;
/**
 * Dependencies
 */
/**
 * Provides convenience methods for normal HTTP responses
 * 
 * @author Randy Casburn <randy@plurious.com>
 * @copyright Copyright Plurious Software, all rights reserved
 * @license MIT
 * @license http://www.opensource.org/licenses/mit-license.html
 * @link http://plurious.com/framework/documentation/classes/Front.html
 * @version 2.1
 * @api
 */
interface Response_Interface {

    /**
     * Adds arbitrary headers to the response
     * 
     * Must be full string headers ready for output
     * 
     * @see $this->redirect() for example usage
     * @param string $header 
     */
    public function addHeader($header);

    /**
     * Sends a redirect header that immediately redirects the client
     * 
     * Exits script execution
     * 
     * @param string $url
     * @param int $status 
     */
    public function redirect($url, $status = 302);

    /**
     * Sets the gzip compression level (0[none] to 9[max])
     * 
     * @param int $level 
     */
    public function setCompression($level);

    /**
     * Determines browser capability for compression and applies compression
     * and returns compressed data if possible. Otherwise returns uncompressed data.
     * 
     * @uses Registry
     * @uses Request
     * @param string $data Data to be compressed
     * @param int $level The g-zip compression level 0[none] to 9[max]
     * @return string The compressed or uncompressed output string
     */
    public function compress($data, $level = 0);

    /**
     * Sends the very final response (possible in compressed form)
     * 
     * @todo finish json and feed implementations
     * 
     * @param string $output The Page content
     * @param string $type One of document, json, atom, rss2.0
     */
    public function output($output, $type);
}

?>